package com.fa4j.product.item.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fa4j.common.data.model.Base;
import com.fa4j.common.data.repository.handler.LongListTypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

/**
 * 实体-商品信息
 *
 * @since 2025-11-22 21:06:24
 */
@Data
@TableName(value = "t_product_item", autoResultMap = true)
@Schema(description = "商品信息")
public class Item extends Base {

    @TableId(type = IdType.AUTO)
    @Schema(description = "主键")
    private Integer id;

    @Schema(description = "商品标题")
    private String title;

    @Schema(description = "商品描述")
    private String description;

    @Schema(description = "商品分类")
    private Integer categoryId;

    @Schema(description = "商品类型")
    private ItemType type;

    @Schema(description = "商品状态")
    private ItemState state;

    @TableField(typeHandler = LongListTypeHandler.class)
    @Schema(description = "商品图片视频列表")
    private List<Long> mediaIds;

    @TableField(exist = false)
    @Schema(description = "商品图片视频列表")
    private List<String> mediaUrls;

    @TableField(typeHandler = LongListTypeHandler.class)
    @Schema(description = "商品详情图片列表")
    private List<Long> detailImgIds;

    @TableField(exist = false)
    @Schema(description = "商品详情图片列表")
    private List<String> detailImgUrls;

    @Schema(description = "商品单位")
    private String unit;

    @TableField(exist = false)
    @Schema(description = "商品规格列表")
    private List<ItemSpec> specList;

    @TableField(exist = false)
    @Schema(description = "商品属性列表")
    private List<ItemAttr> attrList;

    @Schema(description = "操作人ID")
    private Long operatorId;

}
